{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
}}

{{#if loaded}}
  {{#if model.length}}
    <table class='detail-list'>
      <thead>
      <tr>
        <th colspan=2>Stats</th>
      </tr>
      </thead>
      <tbody>
      <tr>
        <td>Total Vertices</td>
        <td>{{stats-link value=stats.totalVertices routeName="dag.vertices"}}</td>
      </tr>
      <tr>
        <td>Succeeded Vertices</td>
        <td>{{stats-link value=stats.succeededVertices routeName="dag.vertices" statsType="SUCCEEDED"}}</td>
      </tr>
      <tr>
        <td>Total Tasks</td>
        <td>{{stats-link value=stats.totalTasks routeName="dag.tasks"}}</td>
      </tr>
      <tr>
        <td>Succeeded Tasks</td>
        <td>{{stats-link value=stats.succeededTasks routeName="dag.tasks" statsType="SUCCEEDED"}}</td>
      </tr>
      <tr>
        <td>Failed Tasks</td>
        <td>{{stats-link value=stats.failedTasks routeName="dag.tasks" statsType="FAILED"}}</td>
      </tr>
      <tr>
        <td>Killed Tasks</td>
        <td>{{stats-link value=stats.killedTasks routeName="dag.tasks" statsType="KILLED"}}</td>
      </tr>
      <tr>
        <td>Failed Task Attempts</td>
        <td>{{stats-link value=stats.failedTaskAttempts routeName="dag.attempts" statsType="FAILED"}}</td>
      </tr>
      <tr>
        <td>Killed Task Attempts</td>
        <td>{{stats-link value=stats.killedTaskAttempts routeName="dag.attempts" statsType="KILLED"}}</td>
      </tr>
      </tbody>
    </table>
  {{/if}}

  {{em-table
    columns=visibleColumns
    rows=model

    definition=definition

    enableSearch=false
    enablePagination=false

    rowCount=model.length
    searchAction="searchChanged"
    sortAction="sortChanged"
    rowAction="rowCountChanged"
    pageAction="pageChanged"

    rowsChanged="rowsChanged"
  }}
{{else}}
  {{partial "loading"}}
{{/if}}
